import Vue from 'vue'
import VueRouter from 'vue-router'
import routeList from "./routes";
//push 
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(to) {
    return VueRouterPush.call(this, to).catch(err => err)
}

// routes
const routes = [...routeList];

Vue.use(VueRouter)

const router = new VueRouter({
    scrollBehavior: () => ({
        y: 0
    }),
    routes
})

export default router